const path = require('path');

module.exports = {
  mode: 'none',
  entry: './src/Webpack/js/index.js',
  output: {
    filename: 'bundle.js',
    path: path.join(__dirname, 'src/Webpack/distWebp'),
    publicPath: 'distWebp/',
  },
  module: {
    rules: [
      {
        test: /.js$/,
        use: {
          loader: 'babel-loader',
          options: {
            presets: ['@babel/preset-env'],
          },
        },
      },
      {
        test: /.css$/,
        use: ['style-loader', 'css-loader'],
      },
      {
        test: /.png$|.jpeg$/,
        use: {
          loader: 'url-loader',
          options: {
            limit: 10 * 1024, // 10KB
          },
        },
      },
      {
        test: /.html$/,
        use: {
          loader: 'html-loader',
          options: {
            attrs: ['img:src', 'a:href'],
          },
        },
      },
      {
        test: /.md$/,
        use: ['html-loader', './src/Webpack/markdown-loader'],
      },
    ],
  },
};
